package com.example;

import com.example.config.WebSocketMessage;
import com.github.jeffreyning.mybatisplus.conf.EnableMPP;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
//        (exclude = {
//        org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
//        org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration.class
//})
@EnableTransactionManagement //事务
@EnableAspectJAutoProxy(exposeProxy = true)
@MapperScan(basePackages = "com.example.mapper")
@EnableAsync //异步
@EnableMPP
@EnableScheduling
public class HzApplication {
    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(HzApplication.class);
        ConfigurableApplicationContext run = springApplication.run(args);
        //解决WebSocket不能注入的问题
        WebSocketMessage.setApplicationContext(run);
    }
}
